package com.xo.common.pojo.dto.req;

import com.xo.common.validator.log.Phone;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Data
@Schema(name = "RegisterDto", description = "账号注册参数")
public class RegisterDto {

    @Schema(description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "用户名不能为空")
    @Length(min = 1, max = 32, message = "用户名长度只能有1-32个字符")
    private String username;

    @Schema(description = "密码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 32, message = "密码不能为空")
    private String password;

    @Schema(description = "昵称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "昵称不能为空")
    private String nickName;

    @Schema(description = "用户类别：1 中台，2 后台，3 零售户", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "用户类别不能为空")
    private Integer userType;

    @Schema(description = "用户图像", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String userPic;


    @Schema(description = "手机号码", requiredMode = Schema.RequiredMode.REQUIRED)
    @Phone
    @NotBlank(message = "手机号码不能为空")
    private String phone;

}
